<template>
  <!--<div class="flight-info"></div>-->
</template>
<script>

// 引入这个页面需要的方法
import {mapMutations, mapGetters} from 'vuex'
 /* eslint-disable */
export default {
  data () {
    return {
      isShowTime: false,
      userSelectTime: ''
      // isEndTime:0
    }
  },
  computed: {
    ...mapGetters([
      'pickType'
    ])
  },
  mounted () {
    this.showTimePicker()
  },
  methods: {
    // 展示时间选择框
    showTimePicker () {
      this.$createTimePicker({
        showNow: true,
        day: {
          len: 3,
          filter: ['今天'],
          format: 'M月d日 '
        },
        // 在选中的时候
        onSelect: (selectedTime, selectedText) => {
          this.$createDialog({
            type: 'warn',
            title: `选中的时间戳是 ${selectedTime}`,
            content: `选中的内容是 ${selectedText}`,
            icon: 'cubeic-alert'
          }).show()
          console.log(selectedText)
          console.log(898989)
          console.log(selectedTime)
          this.setNowtimes(selectedTime)
          this.setTimeInfo(selectedText)
          this.setShowTimeInfo(false)
          if (this.pickType === 1) {
            this.setShowArrival(true)
          } else if (this.pickType === 2) {
            localStorage.setItem('arrivalInfos',selectedTime)
            this.setShowArrival(false)
          }   
          this.setCarStartTime(selectedTime)
        }
      }).show()
    },
    ...mapMutations({
      setShowTimeInfo: 'SET_SHOWTIMEINFO',
      setTimeInfo: 'SET_TIMEINFO',
      setCarStartTime: 'SET_CARSTARTTIME',
      setShowArrival: 'SET_SHOWARRIVAL',
      setNowtimes: 'SET_NOWTIMES'
    })
  }
}
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
.flight-info
  position: fixed
  top: 0
  bottom: 0
  left: 0
  right: 0
  z-index: 99
  width: 100%
  height: 100%
  bordr: 1px solid red
  background-color: rgba(153, 153, 153, .5)
  .inpbox
    height: 50px
    width: 100%
    box-shadow: 0 0 10px #000
    background-color: #fff
.flight-info .inpbox div{
  position: absolute;
  left: 0;
  height: 50px;
}
.flight-info .inpbox input{
  position: absolute;
  left: 0;
  height: 50px;
  margin-left: 40px;
  outline: none;
}
.flight-info .inpbox span{
  position: absolute;
  left: 0;
  width: 40px;
  height: 40px;
}
.flight-info .inpbox p{
  position: absolute;
  top: 50px;
  left: 40px;
  height: 100%;
  width: 200px;
  text-align: left;
  line-height: 50px;
  color: rgb(153,153,153);
}

</style>